package com.kk.springmvc.demo.controller;

import java.util.Map;

import com.kk.springmvc.demo.common.enums.ResultCodeEnum;

/**
* BaseController.java
* 类说明 TODO
*
* @author chengkai
* @date  2017年6月9日 下午3:34:17
*/
public abstract class BaseController {

    private final static String RETURN_CODE = "returnCode";

    private final static String RETURN_MESSAGE = "returnMsg";

    public void createSuccessResult(Map<String, Object> resultMap) {
        resultMap.put(RETURN_CODE, ResultCodeEnum.SUCCESS.getCode());
        resultMap.put(RETURN_MESSAGE, ResultCodeEnum.SUCCESS.getMessage());
    }

    public void createErrorResult(Map<String, Object> resultMap) {
        resultMap.put(RETURN_CODE, ResultCodeEnum.FAIL.getCode());
        resultMap.put(RETURN_MESSAGE, ResultCodeEnum.FAIL.getMessage());
    }

}
